Skip to content

fix(engine): start npm adapters from the registry when the cache is stale - #4255

Merged
LHagfoss merged 1 commit into
mainfrom
fix/engine-npx-stale-cache
Nov 22, 2026
Merged

LHagfoss merged 1 commit into
mainfrom
fix/engine-npx-stale-cache

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

v1.49.0 (#4217) starts the Claude Code and Pi adapters with npx --prefer-offline. npm then trusts its cached package listing, and a computer whose cache predates a dependency of the pinned adapter (@agentclientprotocol/sdk@2.9.1, published 2026-11-21) fails every Claude Code thread at start:

Claude Code: the harness process exited npm ERR! code ETARGET npm ERR! notarget
No matching version found for @agentclientprotocol/sdk@2.9.1.

Retry hits the same cache, so the thread never starts until the user runs npm cache clean --force.

Adapter::start now starts once more without --prefer-offline when the start fails with npm's ETARGET/notarget. npm asks the registry, which also refreshes the cached listing, so later starts are fast again. The check lives in the new harness/npx.rs.

Changelog

Claude Code and Pi threads start again on computers whose npm cache was older than the adapter's dependencies, instead of failing with ETARGET.

Testing

  • Workspace check with tests, rustfmt check, scripts/check-comments.py
  • Unit tests in harness/npx.rs (run in CI): the ETARGET error retries without the flag; other errors and commands without the flag do not.

@github-actions github-actions Bot added the fix A bug fix label Nov 22, 2026
@LHagfoss
LHagfoss merged commit 6ebc8e1 into main Nov 22, 2026
7 checks passed
@LHagfoss
LHagfoss deleted the fix/engine-npx-stale-cache branch November 22, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant